<?php

namespace app\admin\model;

use think\Db;
use think\Model;

/**
 * XPotcheck
 * @controllerUrl 'xPotcheck'
 */
class XPotcheck extends Model
{
    // 表主键
    protected $pk = 'NJNO';
    
    // 表名
    protected $table = 'x_potcheck';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    protected $createTime = false;
    protected $updateTime = false;



    public function getDemoAttr($value, $row)
    {
        return !$value ? '' : $value;
    }

    /**
     * 年检有效期
     * @param $no string 箱号
     */
    public function yxq($no){
        $sql="select max(x_insurance.enddate) from x_insurance,x_insurancepot where x_insurance.policyno=x_insurancepot.policyno and x_insurancepot.tcno=$no";
      return Db::query($sql);
    }
}